home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
aie8911.zip
/
SPECS.DOC
< prev
next >
Wrap
Text File
|
1989-09-21
|
6KB
|
214 lines
SPECS , THE INSTANT RECALL SPECIFICATION INTERPRETER
(C) Copyright 1989 by INSTANT RECALL
All rights reserved.
Use subject to license agreement below.
Instant Recall
5900 Walton Rd.
Bethesda, Md. 20817 USA
(301) 530-0898
SPECS is a program that runs an evolving system specification.
SPECS lets the systems analyst
1. Develop a top-down specification of system logic.
2. Supress unwanted details.
3. Run the specification at any time.
0. GETTING STARTED
~~~~~~~~~~~~~~~~~~~
1. Un-arc the program, if necessary.
2. Make sure the following files are reachable by PATH and
FILEPATH commands:
specs.exe
specs.idb
3. Make sure the file containing your system definition and
a SPECS.INI file which loads the system definition are
in the current directory. NOTE: The SPECS.INI file that
comes with SPECS loads the system defined in V2.ARI.
4. To start SPECS, type SPECS at the DOS prompt as shown:
>SPECS <CR>
5. See section 1.2 for an example of what to do when you are
in SPECS.
6. To exit SPECS, type
halt.
1. A SIMPLE EXAMPLE
~~~~~~~~~~~~~~~~~~~~
1.1 The Specifications
Here is a simple partial specification of a system in SPECS.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A System Specification for SPECS
stub [ call : process_housing_unit( X ) ,
purpose: $processes a housing unit$].
:- turn( process_housing_unit, on).
:- show( process_housing_unit, on).
process_housing_unit( X ) :-
data_collected_q( X ),
!,
put_in_sample( X ).
process_housing_unit( X ) :-
write_error([ $No data for $, X]).
%%%%%%%%%%%% end process_housing_unit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
stub [ call : data_collected_q( Housing_unit ),
purpose: $decides if data was collected for Housing_unit$].
stub [ call : put_in_sample( Housing_unit ),
purpose: $puts data into sample for used for CPI$].
Box 1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The specs consist of two parts: Prolog code that defines the
procedural logic of the parts of the system that have been
defined in some detail; and stubs that define the general
purpose and manner to call procedures that have not been defined.
In the above example, there are 3 procedures, only one of which
has been defined in Prolog.
The Prolog definition of <I>process_housing_unit<R>
says that when data has been collected ( <I>data_collected_q<R> succeeds)
then put t he data in the sample ( with <I>put_in_sample<R>);
otherwise, write an error message. We have not yet defined
how we test whether data has
been collected, how we put it in the sample, or the form of
the data.
Generally, as a system evolves, the definition gets more detailed.
For example, the first version specs for the system in Box 1
might have contained only
stub [ call : process_housing_unit( X ) ,
purpose: $processes a housing unit$].
1.2 A Sample Run
After following the steps of Section 0, Getting Started, you
see on your screen the following: (Note: we will assume you
have loaded the pre-supplied demo file V2.ARI using the
pre-supplied SPECS.INI.
Loading System Description.
consulting v2...consulted!
?>
The first thing we will do is to list the definition of our <I>test<R>.
<I>test<R> is defined in Prolog in the specs file <I>v2.ari<R>.
Our screen now shows
?>listing( test).
test :-
process_housing_unit(1).
Now we'll run test a couple times:
?>test.
process_housing_unit(1) processes a housing unit.
data_collected_q decides if data was collected for Housing_unit.
Is data_collected_q(1) true? ( y or n) : y
?>test.
process_housing_unit(1) processes a housing unit.
data_collected_q decides if data was collected for Housing_unit.
Is data_collected_q(1) true? ( y or n) : n
ACHTUNG, ACHTUNG, ERROR -- No data for 1
Now we'll turn "showing <I>process_housing_unit<R>" off, and
run <I>test<R> again:
?>show( process_housing_unit,off).
?>test.
data_collected_q decides if data was collected for Housing_unit.
Is data_collected_q(1) true? ( y or n) : y
put_in_sample(1) puts data into sample for used for CPI.
When we turn <I>process_housing_unit<R> off, the stub is used
instead of the Prolog definition:
?>turn( process_housing_unit,off).
?>test.
process_housing_unit(1) processes a housing unit.
To leave the system and return to DOS, we do
?>halt.
1.3 Execution Commands
The lines in the example specifications,
:- turn( process_housing_unit, on).
:- show( process_housing_unit, on).
are commands. The <I>turn<R> command says "turn on the Prolog
definition of <I> process_housing_unit<R>. If we wanted to
turn off the Prolog definition, we would write
:- turn( process_housing_unit, off).
When a procedure defined both in Prolog and a stub is turned on,
the Prolog definition is used. When it is turned off, just the
stub is used. The default is that a Prolog-defined procedure is
turned on.
When <I>show<R> for a procedure is turned on, a message is printed
whenever the procedure is entered. No message is printed when
the procedure is turned off.
1.4 Specification load file.
The special file SPECS.INI tells SPECS what specifications to
read in. For example, if the specs are stored in file V2.ARI,
define SPECS.INI as follows:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Example SPECS.INI file
:- rconsult( 'v2.ari' ).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2. Formal Definition of Specifications for SPECS
(to be supplied later)
APPENDIX -- LICENSE AGREEMENT
You may use this program in both source and executable form free of
charge for personal non-commercial use. The program and code may not
be modified, incorporated into other programs, or used commercially
academically or by other organizations without written permission
from Instant Recall.
- EOF -